﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EventList.ascx.cs" Inherits="Framework.Portal.Layouts.Client.Components.Teenio.EventList" %>
<h1 class="title_event">
    <%= MENUNAME %></h1>
<ul class="list_topduthi">
    <li style="border-bottom: none; font-weight: bold; background: #e6e2e1; padding: 10px;
        width: 70px; margin: 0 0 0 -1px; border-left: 1px solid #e6e2e1; border-right: none">
        Top dự thi</li>
    <asp:Repeater ID="rptContent" runat="server" OnItemDataBound="rptContent_ItemDataBound">
        <ItemTemplate>
            <li style="border-top: 1px solid #e6e2e1;">
                <h1 class="num">
                    <asp:Literal ID="lblSTT" runat="server" Text="0"></asp:Literal></h1>
                <div class="righ_list_top">
                    <span class="ava2">
                        <asp:Image ID="imgAvatar" BorderWidth="1" runat="server" ImageUrl="/Uploads/117/1/PreAvatar/ava3.jpg" /></span>
                    <asp:HyperLink ID="hplTitle" runat="server" CssClass="title_a"></asp:HyperLink>
                    <br />
                    <span style="line-height: 30px" class="by">Người gửi:
                        <asp:HyperLink ID="hplAuthor" runat="server"></asp:HyperLink><img src="<%= ImagePath %>images/vote.jpg" />
                        | Ngày gửi:
                        <asp:Literal ID="lblCreateDate" runat="server"></asp:Literal></span><br />
                    <asp:Literal ID="lblTeaser" runat="server"></asp:Literal><br class="clear" />
                </div>
                <br class="clear" />
                <small class="like"><a href="javascript:;"><span id="boxLike_<%# Eval("CONTENT_ID") %>">
                </span></a>Người thích</small> </li>
        </ItemTemplate>
        <AlternatingItemTemplate>
            <li style="border-top: 1px solid #e6e2e1;">
                <h1 class="num">
                    <asp:Literal ID="lblSTT" runat="server" Text="0"></asp:Literal></h1>
                <div class="righ_list_top">
                    <span class="ava2">
                        <asp:Image ID="imgAvatar" BorderWidth="1" runat="server" ImageUrl="/Uploads/117/1/PreAvatar/ava3.jpg" /></span>
                    <asp:HyperLink ID="hplTitle" runat="server" CssClass="title_a"></asp:HyperLink>
                    <br />
                    <span style="line-height: 30px" class="by">Người gửi:
                        <asp:HyperLink ID="hplAuthor" runat="server"></asp:HyperLink><img src="<%= ImagePath %>images/vote.jpg" />
                        | Ngày gửi:
                        <asp:Literal ID="lblCreateDate" runat="server"></asp:Literal></span><br />
                    <asp:Literal ID="lblTeaser" runat="server"></asp:Literal><br class="clear" />
                </div>
                <br class="clear" />
                <small class="like"><a href="javascript:;"><span id="boxLike_<%# Eval("CONTENT_ID") %>">
                </span></a>Người thích</small> </li>
        </AlternatingItemTemplate>
    </asp:Repeater>
    <li style="border-right: 1px solid #e6e2e1 !important; border: none;">
        <asp:Literal ID="lblPaging" runat="server"></asp:Literal>
        <br class="clear" />
    </li>
</ul>
<script type="text/javascript">
    var arrayArticle = <%= arrayArticle %>;
    $(document).ready(function () {        
         $.each(arrayArticle, function(index, value) { 
            $.ajax({
                type: "POST",
                cache: false,
                url: "Resources.ashx?module=contribution&action=getcontribution",
                data: { "articleId": value},
                success: function (html) {
                    $("#boxLike_" + value).html(html.Likes.length);
                },
                timeout: 5000,
                complete: function () {    

                }
            });
        });        
    });
</script>
